package cn.zr.aitool.factory;

import cn.zr.aitool.Constants;
import cn.zr.aitool.bean.ContentBean;
import cn.zr.aitool.model.GuPiaoImpl;
import cn.zr.aitool.model.HouseImpl;
import cn.zr.aitool.model.IContentModel;
import cn.zr.aitool.model.JiJinImpl;
import cn.zr.aitool.model.P2PImpl;

/**
 * 文件名称:
 * 功能描述:
 * 创建者: zhengrui
 * 创建时间: 2018/8/28
 * 修改者: zhengrui
 * Copyright (C) 2017 猎户星空
 *
 * @author zhengrui
 */
public class ModelFactory {

    public static IContentModel getContenModel(int position, ContentBean bean) {
        IContentModel model;
        switch (position) {
            case Constants.POSITION_P2P:
                model = new P2PImpl(bean);
                break;
            case Constants.POSITION_JIJIN:
                model = new JiJinImpl(bean);
                break;
            case Constants.POSITION_GUPIAO:
                model = new GuPiaoImpl(bean);
                break;
            case Constants.POSITION_HOUSE:
                model = new HouseImpl(bean);
                break;
            default:
                model = new GuPiaoImpl(bean);
        }
        return model;
    }

    public static IContentModel getEditModel(int position) {
        return getContenModel(position, new ContentBean());
    }
}
